package com.bjfu.intelligentrecognizeserver.mapper;

import com.bjfu.intelligentrecognizeserver.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    void register(User user);

    //根据用户名查询用户是否存在
    @Select("select * from user where username = #{username}")
    User selectUserByUsername(String username);

    //根据手机号查询用户
    @Select("select * from user where phone = #{phone}")
    User selectUserByPhone(String phone);

    @Select("select * from user where id = #{userId}")
    User selectUserById(Integer userId);
}
